
package cn.edu.cug.cs.gtl.apis.ui.projecttree;


import cn.edu.cug.cs.gtl.protos.Layer;
import cn.edu.cug.cs.gtl.protos.Map;
import cn.edu.cug.cs.gtl.protos.Project;

public class ProjectTreeNodeData {

	private String text;
	private boolean checked;

	Object refObject =null;

	public ProjectTreeNodeData(Object refObject , final String text, final boolean checked) {
		this.text = text;
		this.checked = checked;
		this.refObject=refObject;
	}


	public ProjectTreeNodeData(Project project, boolean checked) {
		this.text = "Project";
		this.checked = checked;
		this.refObject = project;
	}

	public ProjectTreeNodeData(Map map, boolean checked) {
		this.text = map.getName();
		this.checked = checked;
		this.refObject=map;
	}

	public ProjectTreeNodeData(Layer layer, boolean checked) {
		this.text = layer.getName();
		this.checked = checked;
		this.refObject=layer;
	}

	public Object getRefObject() {
		return refObject;
	}

	public void setRefObject(Object refObject) {
		this.refObject = refObject;
	}

	public boolean isChecked() {
		return checked;
	}

	public void setChecked(final boolean checked) {
		this.checked = checked;
	}

	public String getText() {
		return text;
	}

	public void setText(final String text) {
		this.text = text;
	}

	@Override
	public String toString() {
		return getClass().getName() + "[" + text + "/" + checked + "]";
	}

}
